package com.cardvalue.sys.tool;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * Created by cardvalue on 2016/5/12.
 */
public class DateFormatTool {

    public static int decDate(String start,String end){
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        DateFormat df1= new SimpleDateFormat("yyyy-MM-dd");

        Date date =new Date();
        Date date1 = new Date();
        try {
            date = df.parse(start);
            date1 = df1.parse(end);
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        long s = date.getTime();
        long e = date1.getTime();
        return (int)((e-s)/1000/60/60/24);

    }
}
